package cn.com.lei.du.controller;

import cn.com.lei.du.entity.User;
import cn.com.lei.du.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/findById")
    public User findById(String id){
        return userService.findById(id);
    }

    @PostMapping("/addUser")
    public User addUser(User user){
        return userService.addUser(user);
    }
}
